﻿using DataModels.Enums.Bill;
using SqlSugar;
using static DataModels.Enums.GeneralEnum;

namespace DataModels.Entities.Bill
{
    [SugarTable]
    public class BillMain
    {
        [SugarColumn(IsPrimaryKey = true)]
        public Guid UUID { get; set; } = Guid.NewGuid();

        /// <summary>
        /// 创建人
        /// </summary>
        public Guid UserUUID { get; set; }

        public string UserName { get; set; }

        public string Phone { get; set; }

        /// <summary>
        /// 账单编号
        /// </summary>
        public string NO { get; set; } = Utils.MicrosecondTimeStamp.GenerateUniqueId();

        /// <summary>
        /// 业务类型
        /// </summary>
        public BusinessType BusinessType { get; set; }

        /// <summary>
        /// 支付方式
        /// </summary>
        public PayWay PayWay { get; set; }

        /// <summary>
        /// 支付单号（第三方）
        /// </summary>
        public string PayNo { get; set; }

        /// <summary>
        /// 支付类型
        /// </summary>
        public PaymentType PayType { get; set; }

        /// <summary>
        /// 支付金额
        /// </summary>
        public decimal PayAmount {  get; set; }

        /// <summary>
        /// 支付状态
        /// </summary>
        public PaymentStatus PayStatus { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime PayTime { get; set; }

        /// <summary>
        /// 支付备注
        /// </summary>
        public string PayRemark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 退款时关联支付单号
        /// </summary>
        public string RefundId {  get; set; }

        /// <summary>
        /// 扩展数据
        /// </summary>
        public string ExtraData { get; set; } // 扩展数据

        /// <summary>
        /// 订单操作的内容，如：车位管理费6个月，房屋管理费3个月；用于用户查看记录
        /// </summary>
        public string Remark { get; set; }
    }
}
